import req from '@/http/http'
import config from '@/config/index'
const ZHPQ_SERVER = config.serverUrl()

// 门户栏目
// 新增栏目
export const createColumn = data => {
  let path = ZHPQ_SERVER + '/portalColumn/'
  return req.post(path, data)
}
// 查询列表
export const findColumn = data => {
  let path = ZHPQ_SERVER + '/portalColumn'
  return req.get(path, data)
}
// 修改栏目
export const updateColumn = data => {
  let path = ZHPQ_SERVER + '/portalColumn/' + data.id
  return req.put(path, data)
}
// 删除栏目
export const deleteColumn = data => {
  let path = ZHPQ_SERVER + '/portalColumn/' + data.id
  return req.delete(path)
}
// 获取当条详细信息
export const getColumn = id => {
  let path = ZHPQ_SERVER + '/portalColumn/' + id
  return req.get(path)
}
// 栏目树
export const getColumnTree = id => {
  let path = ZHPQ_SERVER + '/portalColumn/tree'
  return req.get(path)
}

// 门户内容
// 新增文章
export const createArticle = data => {
  let path = ZHPQ_SERVER + '/portalContent/'
  return req.post(path, data)
}
// 查询列表
export const findArticle = data => {
  let path = ZHPQ_SERVER + '/portalContent'
  return req.get(path, data)
}
// 修改栏目
export const updateArticle = data => {
  let path = ZHPQ_SERVER + '/portalContent/' + data.id
  return req.put(path, data)
}
// 删除栏目
export const deleteArticle = data => {
  let path = ZHPQ_SERVER + '/portalContent/' + data.id
  return req.delete(path)
}
// 获取当条详细信息
export const getArticle = id => {
  let path = ZHPQ_SERVER + '/portalContent/' + id
  return req.get(path)
}

// 站点信息

export const createSite = data => {
  let path = ZHPQ_SERVER + '/siteInfo/'
  return req.post(path, data)
}
// 查询站点信息
export const getSite = data => {
  let path = ZHPQ_SERVER + '/siteInfo/site'
  return req.get(path, data)
}
